package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.pojo.Student;
import com.itheima.service.impl.StudentserviceA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StudentController {
    //这个笔通过全局bean全局扫描
    @Autowired
    private  StudentserviceA studentserviceA;
    @RequestMapping("/listStu")
    public Result listStudent(){
        List<Student> studentList = studentserviceA.empService();


        //3. 响应数据
        return Result.success(studentList);
    }

}
